<template>
	<view class="leave">
		<view class="main">
			<view class="p">留言标题</view>
			<view class="nr">{{initData.title}}</view>
			<view class="p">留言内容</view>
			<view class="nr">{{initData.content}}</view>
			<view class="p">回复内容</view>
			<view class="nr">
				{{initData.replyContent}}
			</view>
			<view class="button" @click="go_add()" >在线留言</view>
		</view>
	</view>
</template>
<script>
import leave from '../../../servers/my/leave.js';
export default {
	data() {
		return {
			initData: '',
			id: ''
		};
	},
	mounted() {
		this.id = uni.getStorageSync('shopleave')||this.$route.query.shopleave
		if(this.id){
			this.getDate( this.id)
		}
	},
	methods: {
		getDate(e) {
			leave
				.selectDetail(e+'')
				.then(res => {
					if (res.code == 200) {
						this.initData = res.data;
					}
				})
				.catch(err => {
					console.log(new Error('请检查网络后重试'));
				});
		},
		go_add(){
			uni.navigateTo({
				url: '/pages/shop/my/leave_add'
			});
		}
		
	}
};
</script>
<style lang="less" scoped>
page {
	background: #ffffff;
}
.leave {
	height: 100%;
	.main {
		// position: absolute;
		// top: 80rpx;
		// bottom: 0;
		// width: 100%;
		// overflow: auto;
		// background: #fff;
		padding: 0 20rpx;
		box-sizing: border-box;
		.p {
			margin: 39rpx 0 20rpx;
			font-size: 28rpx;
		}
		.nr {
			padding: 20rpx;
			background: #f4f4f4;
			color: #999999;
			font-size: 24rpx;
			line-height: 40rpx;
			border-radius: 12rpx;
		}
		.button {
			margin: 92rpx 20rpx 40rpx;
			line-height: 90rpx;
			background: linear-gradient(80deg, #d2158a, #fc6395);
			text-align: center;
			color: #fff;
			border-radius: 45rpx;
			font-size: 32rpx;
			box-shadow: 3rpx 0 20rpx rgba(206, 205, 204, 0.35);
		}
	}
}
</style>
